package abstractfactory;

/**
 * 提供一个创建一系列相关或相互依赖对象的接口，而无需指定它们具体的类。
 */
public class Test {
    public static void main(String[] args) {
        Client modernClient = new Client(new ModernFactory());
        Chair chair1 = modernClient.factory.createChair();
        Sofa sofa1 = modernClient.factory.createSofa();
        chair1.sitOn();
        System.out.println(sofa1.getMaterial());

        System.out.println("------------------------------------------------------");

        Client victorianClient = new Client(new VictorianFactory());
        Chair chair2 = victorianClient.factory.createChair();
        Sofa sofa2 = victorianClient.factory.createSofa();
        chair2.sitOn();
        System.out.println(sofa2.getMaterial());
    }
}